package com.lhwb.escsvinput.vo;

import java.util.List;

import com.alibaba.excel.annotation.ExcelProperty;

import com.lhwb.escsvinput.vo.conver.CastListConverter;
import com.lhwb.escsvinput.vo.conver.GenreListConverter;
import com.lhwb.escsvinput.vo.conver.KeywordListConverter;
import com.lhwb.escsvinput.vo.conver.ProductionCompanyListConverter;
import com.lhwb.escsvinput.vo.conver.ProductionCountryListConverter;
import com.lhwb.escsvinput.vo.conver.SpokenLanguageListConverter;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.rely.FieldType;
import org.dromara.easyes.annotation.rely.IdType;

@Data
@NoArgsConstructor
@AllArgsConstructor
@IndexName(value = "tmdb", replicasNum = 0)
public class TmdbIndex {

    @IndexId(type = IdType.CUSTOMIZE)
    @ExcelProperty(value = "id")
    private String id;

    @ExcelProperty(value = "budget")
    private String budget;

    @ExcelProperty(value = "genres", converter = GenreListConverter.class)
    @IndexField(fieldType = FieldType.NESTED, nestedClass = Genre.class)
    private List<Genre> genres;

    @IndexField(fieldType = FieldType.TEXT)
    @ExcelProperty(value = "homepage")
    private String homepage;


    @ExcelProperty(value = "keywords", converter = KeywordListConverter.class)
    @IndexField(fieldType = FieldType.NESTED, nestedClass = Keyword.class)
    private List<Keyword> keywords;

    @ExcelProperty(value = "original_language")
    private String originalLanguage;

    @ExcelProperty(value = "original_title")
    private String originalTitle;

    @ExcelProperty(value = "overview")
    private String overview;

    @ExcelProperty(value = "popularity")
    private String popularity;

    @ExcelProperty(value = "production_companies", converter = ProductionCompanyListConverter.class)
    @IndexField(fieldType = FieldType.NESTED, nestedClass = ProductionCompany.class)
    private List<ProductionCompany> productionCompanies;

    @ExcelProperty(value = "production_countries", converter = ProductionCountryListConverter.class)
    @IndexField(fieldType = FieldType.NESTED, nestedClass = ProductionCountry.class)
    private List<ProductionCountry> productionCountries;

    @ExcelProperty(value = "release_date")
    private String releaseDate;

    @ExcelProperty(value = "revenue")
    private String revenue;

    @ExcelProperty(value = "runtime")
    private String runtime;

    @ExcelProperty(value = "spoken_languages", converter = SpokenLanguageListConverter.class)
    @IndexField(fieldType = FieldType.NESTED, nestedClass = SpokenLanguage.class)
    private List<SpokenLanguage> spokenLanguages;

    @ExcelProperty(value = "status")
    private String status;

    @ExcelProperty(value = "tagline")
    private String tagline;

    @ExcelProperty(value = "title")
    private String title;

    @ExcelProperty(value = "vote_average")
    private String voteAverage;

    @ExcelProperty(value = "vote_count")
    private String voteCount;

    @ExcelProperty(value = "cast", converter = CastListConverter.class)
    @IndexField(fieldType = FieldType.NESTED, nestedClass = Cast.class)
    private List<Cast> cast;

}

